.class public Lcom/xingbook/group/adapter/a;
.super Landroid/widget/BaseAdapter;


# instance fields
.field private a:Ljava/util/List;

.field private b:Landroid/view/LayoutInflater;

.field private c:I

.field private d:I

.field private e:I


# direct methods
.method public constructor <init>(Landroid/content/Context;Ljava/util/List;)V
    .locals 2

    invoke-direct {p0}, Landroid/widget/BaseAdapter;-><init>()V

    const/4 v0, 0x0

    iput v0, p0, Lcom/xingbook/group/adapter/a;->c:I

    invoke-virtual {p1}, Landroid/content/Context;->getApplicationContext()Landroid/content/Context;

    move-result-object v0

    invoke-static {v0}, Landroid/view/LayoutInflater;->from(Landroid/content/Context;)Landroid/view/LayoutInflater;

    move-result-object v0

    iput-object v0, p0, Lcom/xingbook/group/adapter/a;->b:Landroid/view/LayoutInflater;

    iput-object p2, p0, Lcom/xingbook/group/adapter/a;->a:Ljava/util/List;

    invoke-interface {p2}, Ljava/util/List;->size()I

    move-result v0

    iput v0, p0, Lcom/xingbook/group/adapter/a;->c:I

    instance-of v0, p1, Landroid/app/Activity;

    if-eqz v0, :cond_0

    check-cast p1, Landroid/app/Activity;

    :goto_0
    invoke-static {p1}, Lcom/xingbook/c/n;->b(Landroid/app/Activity;)F

    move-result v0

    const/high16 v1, 0x4270

    mul-float/2addr v1, v0

    float-to-int v1, v1

    iput v1, p0, Lcom/xingbook/group/adapter/a;->d:I

    const/high16 v1, 0x4170

    mul-float/2addr v0, v1

    float-to-int v0, v0

    iput v0, p0, Lcom/xingbook/group/adapter/a;->e:I

    return-void

    :cond_0
    const/4 p1, 0x0

    goto :goto_0
.end method


# virtual methods
.method public getCount()I
    .locals 1

    iget v0, p0, Lcom/xingbook/group/adapter/a;->c:I

    return v0
.end method

.method public getItem(I)Ljava/lang/Object;
    .locals 1

    iget-object v0, p0, Lcom/xingbook/group/adapter/a;->a:Ljava/util/List;

    invoke-interface {v0, p1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    return-object v0
.end method

.method public getItemId(I)J
    .locals 2

    int-to-long v0, p1

    return-wide v0
.end method

.method public getView(ILandroid/view/View;Landroid/view/ViewGroup;)Landroid/view/View;
    .locals 8

    const/4 v7, 0x0

    iget-object v0, p0, Lcom/xingbook/group/adapter/a;->a:Ljava/util/List;

    invoke-interface {v0, p1}, Ljava/util/List;->get(I)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Lcom/xingbook/group/a/a;

    if-nez p2, :cond_0

    new-instance v2, Lcom/xingbook/group/adapter/b;

    invoke-direct {v2, p0}, Lcom/xingbook/group/adapter/b;-><init>(Lcom/xingbook/group/adapter/a;)V

    iget-object v1, p0, Lcom/xingbook/group/adapter/a;->b:Landroid/view/LayoutInflater;

    const v3, 0x7f030021

    invoke-virtual {v1, v3, v7}, Landroid/view/LayoutInflater;->inflate(ILandroid/view/ViewGroup;)Landroid/view/View;

    move-result-object p2

    const v1, 0x7f0a011c

    invoke-virtual {p2, v1}, Landroid/view/View;->findViewById(I)Landroid/view/View;

    move-result-object v1

    check-cast v1, Landroid/widget/ImageView;

    iput-object v1, v2, Lcom/xingbook/group/adapter/b;->a:Landroid/widget/ImageView;

    iget-object v1, v2, Lcom/xingbook/group/adapter/b;->a:Landroid/widget/ImageView;

    iget v3, p0, Lcom/xingbook/group/adapter/a;->e:I

    iget v4, p0, Lcom/xingbook/group/adapter/a;->e:I

    iget v5, p0, Lcom/xingbook/group/adapter/a;->e:I

    iget v6, p0, Lcom/xingbook/group/adapter/a;->e:I

    invoke-virtual {v1, v3, v4, v5, v6}, Landroid/widget/ImageView;->setPadding(IIII)V

    iget-object v1, v2, Lcom/xingbook/group/adapter/b;->a:Landroid/widget/ImageView;

    invoke-virtual {v1}, Landroid/widget/ImageView;->getLayoutParams()Landroid/view/ViewGroup$LayoutParams;

    move-result-object v1

    iget v3, p0, Lcom/xingbook/group/adapter/a;->d:I

    iget v4, p0, Lcom/xingbook/group/adapter/a;->e:I

    mul-int/lit8 v4, v4, 0x2

    add-int/2addr v3, v4

    iput v3, v1, Landroid/view/ViewGroup$LayoutParams;->width:I

    iget-object v1, v2, Lcom/xingbook/group/adapter/b;->a:Landroid/widget/ImageView;

    invoke-virtual {v1}, Landroid/widget/ImageView;->getLayoutParams()Landroid/view/ViewGroup$LayoutParams;

    move-result-object v1

    iget v3, p0, Lcom/xingbook/group/adapter/a;->d:I

    iget v4, p0, Lcom/xingbook/group/adapter/a;->e:I

    mul-int/lit8 v4, v4, 0x2

    add-int/2addr v3, v4

    iput v3, v1, Landroid/view/ViewGroup$LayoutParams;->height:I

    invoke-virtual {p2, v2}, Landroid/view/View;->setTag(Ljava/lang/Object;)V

    move-object v1, v2

    :goto_0
    iget v2, v0, Lcom/xingbook/group/a/a;->a:I

    const v3, 0x7f02017b

    if-ne v2, v3, :cond_1

    invoke-virtual {p2, v7}, Landroid/view/View;->setBackgroundDrawable(Landroid/graphics/drawable/Drawable;)V

    iget-object v1, v1, Lcom/xingbook/group/adapter/b;->a:Landroid/widget/ImageView;

    iget v0, v0, Lcom/xingbook/group/a/a;->a:I

    invoke-virtual {v1, v0}, Landroid/widget/ImageView;->setImageResource(I)V

    :goto_1
    return-object p2

    :cond_0
    invoke-virtual {p2}, Landroid/view/View;->getTag()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Lcom/xingbook/group/adapter/b;

    goto :goto_0

    :cond_1
    iget-object v2, v0, Lcom/xingbook/group/a/a;->b:Ljava/lang/String;

    invoke-static {v2}, Landroid/text/TextUtils;->isEmpty(Ljava/lang/CharSequence;)Z

    move-result v2

    if-eqz v2, :cond_2

    invoke-virtual {p2, v7}, Landroid/view/View;->setBackgroundDrawable(Landroid/graphics/drawable/Drawable;)V

    iget-object v0, v1, Lcom/xingbook/group/adapter/b;->a:Landroid/widget/ImageView;

    invoke-virtual {v0, v7}, Landroid/widget/ImageView;->setImageDrawable(Landroid/graphics/drawable/Drawable;)V

    goto :goto_1

    :cond_2
    const v2, 0x7f02017c

    invoke-virtual {p2, v2}, Landroid/view/View;->setBackgroundResource(I)V

    iget-object v2, v1, Lcom/xingbook/group/adapter/b;->a:Landroid/widget/ImageView;

    invoke-virtual {v2, v0}, Landroid/widget/ImageView;->setTag(Ljava/lang/Object;)V

    iget-object v1, v1, Lcom/xingbook/group/adapter/b;->a:Landroid/widget/ImageView;

    iget v0, v0, Lcom/xingbook/group/a/a;->a:I

    invoke-virtual {v1, v0}, Landroid/widget/ImageView;->setImageResource(I)V

    goto :goto_1
.end method
